package me.mcx.mcx.service.impl;

import java.util.List;
import me.mcx.common.utils.DateUtils;
import me.mcx.mcx.domain.McxStudy;
import me.mcx.mcx.mapper.McxStudyMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import me.mcx.mcx.service.IMcxStudyService;

/**
 * 学习模块Service业务层处理
 * 
 * @author mcx
 * @date 2024-09-21
 */
@Service
public class McxStudyServiceImpl implements IMcxStudyService 
{
    @Autowired
    private McxStudyMapper mcxStudyMapper;

    /**
     * 查询学习模块
     * 
     * @param id 学习模块主键
     * @return 学习模块
     */
    @Override
    public McxStudy selectMcxStudyById(Long id)
    {
        return mcxStudyMapper.selectMcxStudyById(id);
    }

    /**
     * 查询学习模块列表
     * 
     * @param mcxStudy 学习模块
     * @return 学习模块
     */
    @Override
    public List<McxStudy> selectMcxStudyList(McxStudy mcxStudy)
    {
        return mcxStudyMapper.selectMcxStudyList(mcxStudy);
    }

    /**
     * 新增学习模块
     * 
     * @param mcxStudy 学习模块
     * @return 结果
     */
    @Override
    public int insertMcxStudy(McxStudy mcxStudy)
    {
        mcxStudy.setCreateTime(DateUtils.getNowDate());
        return mcxStudyMapper.insertMcxStudy(mcxStudy);
    }

    /**
     * 修改学习模块
     * 
     * @param mcxStudy 学习模块
     * @return 结果
     */
    @Override
    public int updateMcxStudy(McxStudy mcxStudy)
    {
        mcxStudy.setUpdateTime(DateUtils.getNowDate());
        return mcxStudyMapper.updateMcxStudy(mcxStudy);
    }

    /**
     * 批量删除学习模块
     * 
     * @param ids 需要删除的学习模块主键
     * @return 结果
     */
    @Override
    public int deleteMcxStudyByIds(Long[] ids)
    {
        return mcxStudyMapper.deleteMcxStudyByIds(ids);
    }

    /**
     * 删除学习模块信息
     * 
     * @param id 学习模块主键
     * @return 结果
     */
    @Override
    public int deleteMcxStudyById(Long id)
    {
        return mcxStudyMapper.deleteMcxStudyById(id);
    }
}
